{include file="admin/top.php" subject='income'}
{include file="income/top.php" subject='income'}

<div id="content">
  <form method="post">
    <table width="100%" border="0" cellpadding="5" cellspacing="0" id="editor">
      <tr>
        <td width="100" class="title">仓库: *</td>
        <td width="240" class="content"><select name="shopid">{shops}<option value="{$shops.id}" {if $shops.id==$smarty.post.shopid}selected{elseif (!$smarty.post.shopid)&&$shops.id==$smarty.get.shopid}selected{/if} {if 1==$shops.disabled}disabled{/if}>{$shops.title}</option>{/shops}</select></td>
        <td width="804" class="content">
        {if $errors.empty_shopid}<span class="warning">请选择仓库</span>
        {else}&nbsp;{/if}
        </td>
      </tr>
      <tr>
        <td class="title">产品名称: *</td>
        <td class="content"><input name="product" type="text" id="product" value="{$smarty.post.product}" size="30" onclick="select()"
        onkeyup="context_menu_products(this, 'productid=[product_sku_id],product=[title],spec=[spec],unit=[unit],pricebuy=[pricebuy]')"
        onfocus="context_menu_products(this, 'productid=[product_sku_id],product=[title],spec=[spec],unit=[unit],pricebuy=[pricebuy]')" />
        </td>
        <td class="content">
        {if $errors.empty_product}<span class="warning">产品名称不能为空</span>
        {elseif $errors.unexist_product}<span class="warning">产品数据中找不到该产品</span>
        {else}在此输入/选择产品编号后产品信息会自动填写
        {/if}
        </td>
      </tr>
     <tr style="display:none;">
        <td class="title">产品编号:</td>
        <td class="content"><input name="productid" type="text" id="productid" value="{$smarty.post.productid}" size="30" readonly="readonly" /></td>
        <td class="content">&nbsp;</td>
      </tr>
      <tr>
        <td class="title">产品批号:</td>
        <td class="content"><input name="lotnumber" type="text" id="lotnumber" value="{$smarty.post.lotnumber}" size="30" /></td>
        <td class="content">
<!--         {if $errors.empty_lotnumber}<span class="warning">产品批号不能为空</span> -->
<!--         {else}&nbsp;{/if} -->
        </td>
      </tr>
      <tr>
        <td class="title">产品规格:</td>
        <td class="content"><input name="spec" type="text" id="spec" value="{$smarty.post.spec}" size="30" /></td>
        <td class="content">例如：50ml,200g,5kg,0.5g×20 等</td>
      </tr>
      <tr>
        <td class="title">产品单位:</td>
        <td class="content"><input name="unit" type="text" id="unit" value="{$smarty.post.unit}" size="30" /></td>
        <td class="content">例如：瓶,袋,箱  等</td>
      </tr>
      <tr>
        <td class="title">入库数量: *</td>
        <td class="content"><input name="number" type="text" id="number" value="{$smarty.post.number}" onchange="$('#pricetotal').val($('#pricebuy').val()*$('#number').val())" size="30" />
        </td>
        <td class="content">
        {if $errors.empty_number}<span class="warning">入库数量不能为空</span>
        {else}&nbsp;{/if}
        </td>
      </tr>
      {if 0}<tr>
        <td class="title">生产日期:</td>
        <td class="content">{html_select_date field_order="YMD" start_year=$start_year end_year=$end_year month_format="%m" prefix="start_" time=$timestart|default:$purchases.timestart}</td>
        <td class="content">&nbsp;</td>
      </tr>{/if}
      <tr style="display:none;">
        <td class="title">保质期:*</td>
        <td class="content"><input name="usedby" type="text" id="usedby" value="365" size="10"/> <select name="usedbyunit" id="usedbyunit"><option value="day">天</option><option value="month">月</option><option value="year">年</option></select></td>
          <td class="content">
        {if $errors.empty_usedby}<span class="warning">保质期不能为空</span>
        {else}&nbsp;{/if}
        </td>
      </tr>
      <tr>
        <td class="title">过期时间:</td>
        <td class="content">{html_select_date field_order="YMD" start_year=$start_year end_year=$end_year month_format="%m" prefix="end_" time=$timeend}</td>
        <td class="content">
		{if $errors.endtime_error}<span class="warning">过期时间不能为今天</span>
        {else}&nbsp;{/if}
		</td>
      </tr>
       <tr>
        <td class="title">到货时间:</td>
        <td class="content">{html_select_date field_order="YMD" start_year=$start_year end_year=$end_year month_format="%m" time=$timeexpress|default:$purchases.timeexpress}</td>
        <td class="content">&nbsp;</td>
      </tr>
       <tr>
        <td class="title">入库类型:</td>
        <td class="content">
        {html_options name=type options=$type}
        
        
        </td>
        <td class="content">&nbsp;</td>
      </tr>
      <tr>
        <td class="title">备注说明:</td>
        <td colspan="2" class="content"><textarea name="memo" cols="80" rows="5"  id="memo">{$smarty.post.memo}</textarea></td>
      </tr>
      <tr class="noline">
      	<td class="title">商品条码数字:</td>
      	<td class="content"><input name="barcode" type="text" id="barcode" value="" maxlength="13" size="30" /></td>
      	<td class="content"><span class="warning">请确认已经完成以上的所有字段，最好最后扫码，因为有可能扫完会自动提交</span></td>
      </tr>
    </table>
    
    <div class="fr mt10">
    <input type="submit" value="添加" class="btn" />
    <a href="#this" class="btn" onclick="location.href='{$site_admin}m=inventory&s=income.php'">取消</a> 
        <input name="action" type="hidden" id="action" value="create" />
    </div>
  </form>
</div>
{include file="admin/bottom.php"}
</body>
</html>
